import book.BookList;
import user.AdminUser;
import user.NormaUser;
import user.User;

import java.util.Scanner;

public class main {
    public static User login(){
        System.out.println("请输入你的姓名");
        Scanner sc=new Scanner(System.in);
        String name=sc.nextLine();
        System.out.println("请输入你的身份，1.管理员    2.普通用户");
        int in=sc.nextInt();
        if(in==1){
            AdminUser adminUser=new AdminUser(name);
            return adminUser;
        }else{
            NormaUser normaUser=new NormaUser(name);
            return normaUser;
        }
    }

    public static void main(String[] args) {
        User user=login();
        BookList bookList=new BookList();
        while(true){
            int choice=user.menu();
            user.doIoperation(choice,bookList);
        }
    }







}
